package jsp.com.pg;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class Sign {

	/**
	 * @param args  username
	 * 				password
	 */
	public static void main(String[] args) {
		Sign nuser = new Sign();
		String username = "eee";
		String password = "555";
		Boolean bl = nuser.signIn(username,password);
		System.out.print(bl.toString());
	}
	public Boolean signIn(String username, String password){
		Statement  st = null;
		Connection con = null;
		
		StringBuffer sb = new StringBuffer();
		sb.append("insert into test_user (username,userpwrd) value ('");
		sb.append(username);
		sb.append("','");
		sb.append(password);
		sb.append("')");
		try {
			Class.forName("com.mysql.jdbc.Driver");
			con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","123456");
			st = con.createStatement();
			st.executeUpdate(sb.toString());
		}catch (Exception e) {
			e.printStackTrace();
		}
		return true;
	}

}
